feat: Added a new utility function typeUtil & fix: Fix bug in clearNullProperties utility function#47
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new type utility function isPlainObject and fixes bugs in the existing clearNullProperties function. The changes enhance the library's type checking capabilities and improve the reliability of object property clearing.
- Added
typeUtilpackage withisPlainObjectfunction for distinguishing plain objects from arrays and other object types - Enhanced export strategy to support both namespace and individual function imports
- Fixed
clearNullPropertiesto properly handle falsy values and use type checking for recursive processing
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| package/typeUtil/isPlainObject/index.ts | New utility function to check if a value is a plain object |
| package/typeUtil/isPlainObject/index.test.ts | Comprehensive test suite for the isPlainObject function |
| package/typeUtil/index.ts | Export configuration for typeUtil package |
| package/objectUtil/clearNullProperties/index.ts | Bug fixes for proper null/undefined handling and array preservation |
| package/objectUtil/clearNullProperties/index.test.ts | Additional test cases covering the bug fixes |
| package/index.ts | Updated exports to include typeUtil with both namespace and individual exports |
| README.md | Documentation updates for the new typeUtil functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Member
Author
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
prgmr99
approved these changes
Sep 24, 2025
|
|
||
| return ( | ||
| Object.getPrototypeOf(value) === Object.prototype || | ||
| Object.getPrototypeOf(value) === null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
typeUtil)가 추가되었어요clearNullProperties유틸 함수의 일부 버그를 수정했어요